package yunquan.wang.modules.base.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import yunquan.wang.base.domain.IdEntity;
@Entity
@Table(name = "base_groupinfo")
public class GroupInfo  extends IdEntity{
	/**
	 * 
	 */
	private static final long serialVersionUID = 8369539425609344086L;
	@Column(name="groupname",length=50)
	private String groupName;//机构名字
	@Column(name="groupinfo",length=50)
	private String groupInfo;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parent_id")
	private GroupInfo parent;
	@Column(name="grouptype",length=2)
	private Integer groupType;
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "parent")
	private List<GroupInfo> childs;
	
	public Integer getGroupType() {
		return groupType;
	}
	public void setGroupType(Integer groupType) {
		this.groupType = groupType;
	}
	public GroupInfo getParent() {
		return parent;
	}
	public void setParent(GroupInfo parent) {
		this.parent = parent;
	}
	public List<GroupInfo> getChilds() {
		return childs;
	}
	public void setChilds(List<GroupInfo> childs) {
		this.childs = childs;
	}
	public String getGroupName() {
		return groupName;
	}
	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
	public String getGroupInfo() {
		return groupInfo;
	}
	public void setGroupInfo(String groupInfo) {
		this.groupInfo = groupInfo;
	}
 
	
}
